package com.juyu.reader.author.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.juyu.reader.author.dao.BookDao;
import com.juyu.reader.author.model.Book;

@Service
public class BookService {
	@Autowired
	private BookDao bookDao;

	public List<Book> findBook(Book book) {
		return bookDao.findBook(book);
	}

	public int countBook(Book book) {
		return bookDao.countBook(book);
	}

	public int insertBook(Book book) {
		return bookDao.insertBook(book);
	}

	public int updateBook(Book book) {
		return bookDao.updateBook(book);
	}

	/**
	 * 更新书籍的最后章节排序号
	 * 
	 * @param book
	 * @return
	 */
	public int updateBookSeq(Book book) {
		return bookDao.updateBookSeq(book);
	}
	/**
	 * 更新书籍的字数和最后更新时间
	 * 
	 * @param book
	 * @return
	 */
	public int updateBookWordsAndLatestDate(Book book) {
		return bookDao.updateBookWordsAndLatestDate(book);
	}
	public int updateBookDefCover(Book book) {
		return bookDao.updateBookDefCover(book);
	}

	public int uploadBookCover(Book book) {
		return bookDao.uploadBookCover(book);
	}

}
